import request from '@/utils/request'

import { authServiceApi, systemServiceApi } from '../config'

const authUrl = authServiceApi + '/token'
export { authUrl }

export function auth(data) {
  return request({
    url: authServiceApi + '/token',
    method: 'post',
    data
  })
}

export function getPermissions(token) {
  return request({
    url: systemServiceApi + '/ui-permissions',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: systemServiceApi + '/logout',
    method: 'post'
  })
}
